#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
#include <set>
#include <stack>
#include <map>
#include <queue>
#include <iostream>
#include <fstream>
#include <unordered_set>
#include <unordered_map>
#include <functional>
#include <utility>
#include "Query.h"

using namespace std;

int main() {
    ifstream ifd("Alice.txt");
    if(!ifd){
        cout<<"open error"<<endl;
        exit(-1);
    }
    TextQuery dist(ifd);
    ifd.close();
    cout<<"===================="<<endl;
    
    Query q("Daddy");
    cout<<q.eval(dist)<<endl;

    cout<<(~Query("Alice")).eval(dist)<<endl;
    
    cout<<(Query("Alice") | Query("hair")).eval(dist)<<endl;
    
    cout<<(Query("Alice") & Query("hair")).eval(dist)<<endl;
    
    cout<<((Query("fiery") & Query("bird")) | Query("wind")).eval(dist)<<endl;
    
    cout << "===========program end============" << endl;
    return 0;
}
